﻿<Application x:Class="WPFGeniusSudoku.GeniusApplication"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Startup="AppOnStartup"
    StartupUri="MainForm.xaml"
    >
    <Application.Resources>
      <DrawingBrush x:Key='Croix'>
        <DrawingBrush.Drawing>
          <DrawingGroup>
            <DrawingGroup.Children>
              <GeometryDrawing Geometry='F1 M 37.5889,329.122L 188.7,480.233'>
                <GeometryDrawing.Pen>
                  <Pen Thickness='40' LineJoin='Round'>
                    <Pen.Brush>
                      <!-- Gray_Highlight -->
                      <LinearGradientBrush StartPoint='0.0697674,0.5' EndPoint='0.930232,0.5'>
                        <LinearGradientBrush.GradientStops>
                          <GradientStop Color='#FF854747' Offset='0'/>
                          <GradientStop Color='#FFD3D5D8' Offset='0.353516'/>
                          <GradientStop Color='#FF9D5353' Offset='1'/>
                        </LinearGradientBrush.GradientStops>
                      </LinearGradientBrush>
                    </Pen.Brush>
                  </Pen>
                </GeometryDrawing.Pen>
              </GeometryDrawing>

              <GeometryDrawing Geometry='F1 M 37.5889,480.233L 188.7,329.122'>
                <GeometryDrawing.Pen>
                  <Pen Thickness='40' LineJoin='Round'>
                    <Pen.Brush>
                      <!-- Gray_Highlight -->
                      <LinearGradientBrush StartPoint='0.0697674,0.5' EndPoint='0.930232,0.5'>
                        <LinearGradientBrush.GradientStops>
                          <GradientStop Color='#FF854747' Offset='0'/>
                          <GradientStop Color='#FFD3D5D8' Offset='0.353516'/>
                          <GradientStop Color='#FF9D5353' Offset='1'/>
                        </LinearGradientBrush.GradientStops>
                      </LinearGradientBrush>
                    </Pen.Brush>
                  </Pen>
                </GeometryDrawing.Pen>
                <GeometryDrawing.Brush>
                  <!-- black_transp -->
                  <LinearGradientBrush StartPoint='0.0697674,0.5' EndPoint='0.930232,0.5'>
                    <LinearGradientBrush.GradientStops>
                      <GradientStop Color='#00702323' Offset='0'/>
                      <GradientStop Color='#FF9C2626' Offset='1'/>
                    </LinearGradientBrush.GradientStops>
                  </LinearGradientBrush>
                </GeometryDrawing.Brush>
              </GeometryDrawing>

            </DrawingGroup.Children>
          </DrawingGroup>
        </DrawingBrush.Drawing>
      </DrawingBrush>
      <Style x:Key="AppCloseButtonStyle" TargetType="{x:Type Button}" BasedOn="{x:Null}">
        <Setter Property="Width" Value="14" />
        <Setter Property="Height" Value="14" />
        <Setter Property="Margin" Value="0,4,0,0" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
              <Grid RenderTransformOrigin="0.5,0.5">
                <Ellipse Opacity="1" x:Name="ClsBtnBase" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                  <Ellipse.Fill>
                    <RadialGradientBrush>
                      <RadialGradientBrush.GradientStops>
                        <GradientStopCollection>
                          <GradientStop Color="#FF000000" Offset="1"/>
                          <GradientStop Color="#FF990000" Offset="0.8"/>
                          <GradientStop Color="#FF000000" Offset="0"/>
                        </GradientStopCollection>
                      </RadialGradientBrush.GradientStops>
                    </RadialGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
                <TextBlock FontSize="10" FontFamily="Trebuchet MS" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Height="Auto" 
                           x:Name="CloseText" RenderTransformOrigin="0.5,0.5" Text="X" TextWrapping="Wrap" Foreground="Gray"/>
                <Ellipse Opacity="0.6" Canvas.Left="0" Canvas.Top="0" x:Name="ClsBtnHighlight" RenderTransformOrigin="0.5,0.5">
                  <Ellipse.Fill>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                      <LinearGradientBrush.GradientStops>
                        <GradientStopCollection>
                          <GradientStop Color="#AAFFFFFF" Offset="0"/>
                          <GradientStop Color="#11FFFFFF" Offset="1"/>
                        </GradientStopCollection>
                      </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                  <Setter TargetName="ClsBtnBase" Property="Fill">
                    <Setter.Value>
                      <RadialGradientBrush>
                        <RadialGradientBrush.GradientStops>
                          <GradientStopCollection>
                            <GradientStop Color="#FF000000" Offset="1"/>
                            <GradientStop Color="#FFEE0000" Offset="0.8"/>
                            <GradientStop Color="#FF000000" Offset="0"/>
                          </GradientStopCollection>
                        </RadialGradientBrush.GradientStops>
                      </RadialGradientBrush>
                    </Setter.Value>
                  </Setter>
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>

          </Setter.Value>
        </Setter>
      </Style>
      <Style x:Key="AppMaximizeButtonStyle" TargetType="{x:Type Button}" BasedOn="{x:Null}">
        <Setter Property="Width" Value="14" />
        <Setter Property="Height" Value="14" />
        <Setter Property="Margin" Value="0,4,0,0" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
              <Grid RenderTransformOrigin="0.5,0.5">
                <Ellipse Opacity="1" x:Name="ClsBtnBase" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                  <Ellipse.Fill>
                    <RadialGradientBrush>
                      <RadialGradientBrush.GradientStops>
                        <GradientStopCollection>
                          <GradientStop Color="#FF000000" Offset="1"/>
                          <GradientStop Color="#FF000099" Offset="0.8"/>
                          <GradientStop Color="#FF000000" Offset="0"/>
                        </GradientStopCollection>
                      </RadialGradientBrush.GradientStops>
                    </RadialGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
                <Rectangle Fill="Transparent" Stroke="Gray" StrokeThickness="1" Margin="3,3,3,3"/>
                <Rectangle Fill="Gray" Stroke="Gray" Height="3" StrokeThickness="1"  Margin="3,3,3,3" VerticalAlignment="Top"/>
                <Ellipse Opacity="0.6" Canvas.Left="0" Canvas.Top="0" x:Name="ClsBtnHighlight" RenderTransformOrigin="0.5,0.5">
                  <Ellipse.Fill>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                      <LinearGradientBrush.GradientStops>
                        <GradientStopCollection>
                          <GradientStop Color="#AAFFFFFF" Offset="0"/>
                          <GradientStop Color="#11FFFFFF" Offset="1"/>
                        </GradientStopCollection>
                      </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                  <Setter TargetName="ClsBtnBase" Property="Fill">
                    <Setter.Value>
                      <RadialGradientBrush>
                        <RadialGradientBrush.GradientStops>
                          <GradientStopCollection>
                            <GradientStop Color="#FF000000" Offset="1"/>
                            <GradientStop Color="#FF0000EE" Offset="0.8"/>
                            <GradientStop Color="#FF000000" Offset="0"/>
                          </GradientStopCollection>
                        </RadialGradientBrush.GradientStops>
                      </RadialGradientBrush>
                    </Setter.Value>
                  </Setter>
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>

          </Setter.Value>
        </Setter>
      </Style>

      <Style x:Key="AppMinimizeButtonStyle" TargetType="{x:Type Button}" BasedOn="{x:Null}">
        <Setter Property="Width" Value="14" />
        <Setter Property="Height" Value="14" />
        <Setter Property="Margin" Value="0,4,0,0" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
              <Grid RenderTransformOrigin="0.5,0.5">
                <Ellipse Opacity="1" x:Name="ClsBtnBase" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                  <Ellipse.Fill>
                    <RadialGradientBrush>
                      <RadialGradientBrush.GradientStops>
                        <GradientStopCollection>
                          <GradientStop Color="#FF000000" Offset="1"/>
                          <GradientStop Color="#FF000099" Offset="0.8"/>
                          <GradientStop Color="#FF000000" Offset="0"/>
                        </GradientStopCollection>
                      </RadialGradientBrush.GradientStops>
                    </RadialGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
                <Rectangle Fill="Gray" Stroke="Gray" Height="3"  Width="7" StrokeThickness="1"  Margin="3,3,3,3" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
                <Ellipse Opacity="0.6" Canvas.Left="0" Canvas.Top="0" x:Name="ClsBtnHighlight" RenderTransformOrigin="0.5,0.5">
                  <Ellipse.Fill>
                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                      <LinearGradientBrush.GradientStops>
                        <GradientStopCollection>
                          <GradientStop Color="#AAFFFFFF" Offset="0"/>
                          <GradientStop Color="#11FFFFFF" Offset="1"/>
                        </GradientStopCollection>
                      </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                  <Setter TargetName="ClsBtnBase" Property="Fill">
                    <Setter.Value>
                      <RadialGradientBrush>
                        <RadialGradientBrush.GradientStops>
                          <GradientStopCollection>
                            <GradientStop Color="#FF000000" Offset="1"/>
                            <GradientStop Color="#FF0000EE" Offset="0.8"/>
                            <GradientStop Color="#FF000000" Offset="0"/>
                          </GradientStopCollection>
                        </RadialGradientBrush.GradientStops>
                      </RadialGradientBrush>
                    </Setter.Value>
                  </Setter>
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>

          </Setter.Value>
        </Setter>
      </Style>
      <LinearGradientBrush x:Key="WindowBackground" StartPoint="1,1" EndPoint="0,0">
          <GradientStop Color="sc#1, 0.192563415, 0.309925854, 1" Offset="0.016025641025641024"/>
          <GradientStop Color="sc#1, 0.2090404, 0.285897851, 1" Offset="1"/>
          <GradientStop Color="sc#1, 0, 0.0690932348, 0.5649899" Offset="0.51602564102564108"/>
      </LinearGradientBrush>
      <Style TargetType="{x:Type Button}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Background">
          <Setter.Value>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
              <GradientStop Offset="1" Color="#FFe0f0f0" />
              <GradientStop Offset="0" Color="#FFb0d8e8" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="#FF001563" />
        <Setter Property="Content" Value="3" />
        <Setter Property="Margin" Value="1" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
              <Grid Width="Auto" Height="25" VerticalAlignment="Top" Grid.Column="1" MinWidth="0" RenderTransformOrigin="0.5,0.5">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                  <RowDefinition/>
                </Grid.RowDefinitions>
                <Rectangle Stroke="#FF4890c8"/>
                <Rectangle x:Name="backRect" Margin="2">
                  <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                      <GradientStop Offset="0" Color="#FFe0f0f0" />
                      <GradientStop Offset="0.8" Color="#FFb0d8e8" />
                      <GradientStop Offset="1" Color="#FFe0f0f0" />
                    </LinearGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <ContentPresenter x:Name="GelButtonContent" VerticalAlignment="center" HorizontalAlignment="center" Content="{TemplateBinding  Content}" 
                                  Margin="5,0,5,0"/>
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                  <Setter TargetName="backRect" Property="Visibility" Value="Collapsed" />
                </Trigger>
                <Trigger Property="IsMouseOver" Value="true">
                  <Setter Property="Rectangle.Fill" TargetName="backRect">
                    <Setter.Value>
                      <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Offset="0" Color="#FFe0f0f0" />
                        <GradientStop Offset="0.8" Color="#66275EB0" />
                        <GradientStop Offset="1" Color="#FFe0f0f0" />
                      </LinearGradientBrush>
                    </Setter.Value>
                  </Setter>
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
        <Style.Triggers>
          <Trigger Property="IsEnabled" Value="False">
            <Setter Property="Background" Value="#FFe0f0f0" />
            <Setter Property="Foreground" Value="DarkGray" />
          </Trigger>
        </Style.Triggers>
      </Style>

    </Application.Resources>
  </Application>
  